import Vue from 'vue';
//配置路由
import VueRouter from 'vue-router'
Vue.use(VueRouter);
//1.创建组件
import Index from '@/views/index'
import Home from '@/views/home'
import Login from '@/views/login'
import NotFound from '@/views/404'
import UpdatePassword from '@/views/update-password'
import pay from '@/views/pay'
import register from '@/views/register'
import center from '@/views/center'
    import jiangoumulu from '@/views/modules/jiangoumulu/list'
    import discussshequziyuan from '@/views/modules/discussshequziyuan/list'
    import xuekegaikuang from '@/views/modules/xuekegaikuang/list'
    import wenxianziyuan from '@/views/modules/wenxianziyuan/list'
    import jiaoshi from '@/views/modules/jiaoshi/list'
    import discussxuekeziyuan from '@/views/modules/discussxuekeziyuan/list'
    import discusskaoyanshequ from '@/views/modules/discusskaoyanshequ/list'
    import storeup from '@/views/modules/storeup/list'
    import rencaipeiyang from '@/views/modules/rencaipeiyang/list'
    import shequziyuan from '@/views/modules/shequziyuan/list'
    import yonghu from '@/views/modules/yonghu/list'
    import discusswenxianziyuan from '@/views/modules/discusswenxianziyuan/list'
    import guanzangmulu from '@/views/modules/guanzangmulu/list'
    import discussxuekedongtai from '@/views/modules/discussxuekedongtai/list'
    import messages from '@/views/modules/messages/list'
    import zhengdingmulu from '@/views/modules/zhengdingmulu/list'
    import xuekedongtai from '@/views/modules/xuekedongtai/list'
    import kaoyanshequ from '@/views/modules/kaoyanshequ/list'
    import xuekeziyuan from '@/views/modules/xuekeziyuan/list'
    import config from '@/views/modules/config/list'
    import junshizixun from '@/views/modules/junshizixun/list'


//2.配置路由   注意：名字
const routes = [{
    path: '/index',
    name: '首页',
    component: Index,
    children: [{
      // 这里不设置值，是把main作为默认页面
      path: '/',
      name: '首页',
      component: Home,
      meta: {icon:'', title:'center'}
    }, {
      path: '/updatePassword',
      name: '修改密码',
      component: UpdatePassword,
      meta: {icon:'', title:'updatePassword'}
    }, {
      path: '/pay',
      name: '支付',
      component: pay,
      meta: {icon:'', title:'pay'}
    }, {
      path: '/center',
      name: '个人信息',
      component: center,
      meta: {icon:'', title:'center'}
    }
      ,{
	path: '/jiangoumulu',
        name: '荐购目录',
        component: jiangoumulu
      }
      ,{
	path: '/discussshequziyuan',
        name: '社区资源评论',
        component: discussshequziyuan
      }
      ,{
	path: '/xuekegaikuang',
        name: '学科概况',
        component: xuekegaikuang
      }
      ,{
	path: '/wenxianziyuan',
        name: '文献资源',
        component: wenxianziyuan
      }
      ,{
	path: '/jiaoshi',
        name: '教师',
        component: jiaoshi
      }
      ,{
	path: '/discussxuekeziyuan',
        name: '学科资源评论',
        component: discussxuekeziyuan
      }
      ,{
	path: '/discusskaoyanshequ',
        name: '考研社区评论',
        component: discusskaoyanshequ
      }
      ,{
	path: '/storeup',
        name: '我的收藏管理',
        component: storeup
      }
      ,{
	path: '/rencaipeiyang',
        name: '人才培养',
        component: rencaipeiyang
      }
      ,{
	path: '/shequziyuan',
        name: '社区资源',
        component: shequziyuan
      }
      ,{
	path: '/yonghu',
        name: '用户',
        component: yonghu
      }
      ,{
	path: '/discusswenxianziyuan',
        name: '文献资源评论',
        component: discusswenxianziyuan
      }
      ,{
	path: '/guanzangmulu',
        name: '馆藏目录',
        component: guanzangmulu
      }
      ,{
	path: '/discussxuekedongtai',
        name: '学科动态评论',
        component: discussxuekedongtai
      }
      ,{
	path: '/messages',
        name: '留言板管理',
        component: messages
      }
      ,{
	path: '/zhengdingmulu',
        name: '征订目录',
        component: zhengdingmulu
      }
      ,{
	path: '/xuekedongtai',
        name: '学科动态',
        component: xuekedongtai
      }
      ,{
	path: '/kaoyanshequ',
        name: '考研社区',
        component: kaoyanshequ
      }
      ,{
	path: '/xuekeziyuan',
        name: '学科资源',
        component: xuekeziyuan
      }
      ,{
	path: '/config',
        name: '轮播图管理',
        component: config
      }
      ,{
	path: '/junshizixun',
        name: '军事资讯',
        component: junshizixun
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta: {icon:'', title:'login'}
  },
  {
    path: '/register',
    name: 'register',
    component: register,
    meta: {icon:'', title:'register'}
  },
  {
    path: '/',
    name: '首页',
    redirect: '/index'
  }, /*默认跳转路由*/
  {
    path: '*',
    component: NotFound
  }
]
//3.实例化VueRouter  注意：名字
const router = new VueRouter({
  mode: 'hash',
  /*hash模式改为history*/
  routes // （缩写）相当于 routes: routes
})

export default router;
